|
|
|
|
Creates and opens a temporary file. A unique name is given by the system to each temporary file.
MonFichierTemporaire is DiskFile
ResOuverture is boolean
ResOuverture = MonFichierTemporaire.OuvreFichierTemp(foReadWrite, "ABC", "C:\MesRépertoires")
IF ResOuverture THEN
...
END
Syntax
Create and open a temporary file in a variable of type DiskFile Hide the details
<Result> = <DiskFile>.fOpenTempFile([<Opening mode> [, <Prefix of temporary file> [, <Directory of temporary file>]]])
<Result>: Boolean - if the temporary file has been created, opened and associated with Variable of type DiskFile,
- False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<DiskFile>: DiskFile variable Name of the Variable DiskFile that will be associated with the temporary file handled. <Opening mode>: Optional constant (or combination of constants) Constants used to define the opening mode of the file, the access mode to the file and the lock mode of the file. <Prefix of temporary file>: Optional character string Prefix (3 letters) for the name of the temporary file. This parameter is used to prefix the name of the temporary file. Only the first three letters will be taken into account.
<Directory of temporary file>: Optional character string Full or relative directory of the temporary file (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with the "\" character. This directory must exist. Otherwise, a WLanguage error occurs.If this parameter is not specified, the default directory will be: - the temporary directory of Windows (if this directory exists on the current computer),
- the current directory (if the temporary directory of Windows does not exist on the current computer).
Remarks OpenTempFile throws an error in the following cases: - the specified directory does not exist,
- the file is locked by another computer or by another application,
- the user has no read or write rights on the file to open.
Business / UI classification: Business Logic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|